<?php namespace App\Repositories\Item;

use App\Repositories\Eloquent\Item\Entity\ProjectEntity;

interface ProjectRepositoryInterface
{
    /**
     * 获取项目信息
     *
     * @param $id
     *
     * @return \Illuminate\Database\Eloquent\Collection|\App\Models\Project|\App\Models\Project[]
     */
    public function show($id);

    /**
     * 新增项目
     *
     * @param ProjectEntity $entity
     *
     * @return Project
     */
    public function store(ProjectEntity $entity);

    /**
     * 修改项目信息
     *
     * @param               $id
     * @param ProjectEntity $entity
     *
     * @return Project|Project[]|\Illuminate\Database\Eloquent\Collection
     */
    public function update($id, ProjectEntity $entity);

    /**
     * 获取用户项目
     *
     * @param     $creator_uid
     * @param int $per_page
     *
     * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
     */
    public function lists($creator_uid, $per_page = 10);

    /**
     * 判断用户是否拥有该公司
     *
     * @param $user_id
     * @param $project_id
     *
     * @return bool
     */
    public function checkUserHasProject($user_id, $project_id);
}
